﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Forums.MicrosoftForumsProvider.Forums;

namespace Microsoft.Forums.Tests.MicrosoftForumsProvider.Stubs
{
    /// <summary>
    /// A stub implementation of the IFullForumsService
    /// This will be used to let use determine what is returned to the MicrosoftForumsServiceProvider
    /// </summary>
    public class ForumsServiceStub : IFullForumsService
    {

        /// <summary>
        /// What will be returned by GetAllForums
        /// </summary>
        public List<BriefForum> GetAllForumsBrief_Result { get; set; }

        /// <summary>
        /// What will be returned by GetAllForums
        /// </summary>
        public List<Forum> GetAllForums_Result { get; set; }


        /// <summary>
        /// What will be returned by GetUpdatedThreads
        /// </summary>
        public List<BriefThread> GetUpdatedThreads_Result { get; set; }

        /// <summary>
        /// What will be returned by GetCreatedThreads
        /// </summary>
        public List<BriefThread> GetCreatedThreads_Result { get; set; }

        /// <summary>
        /// What will be returned by GetForumThreads
        /// </summary>
        public List<BriefThread> GetForumThreads_Result { get; set; }

        /// <summary>
        /// What will be returned by GetUpdatedMessages
        /// </summary>
        public List<BriefMessage> GetNewOrModifiedMessages_Result { get; set; }

        /// <summary>
        /// What will be returned by GetMessagesByThread
        /// </summary>
        public List<BriefMessage> GetThreadMessages_Result { get; set; }


        #region IFullForumsService Members

        /// <summary>
        /// Gets the user brief.
        /// </summary>
        /// <param name="userId">The user id.</param>
        /// <returns></returns>
        public BriefUser GetUserBrief(Guid userId)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the thread messages brief.
        /// </summary>
        /// <param name="threadId">The thread id.</param>
        /// <param name="pageIndex">Index of the page.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <param name="loadBody">if set to <c>true</c> [load body].</param>
        /// <returns></returns>
        public BriefMessagesContainer GetThreadMessagesBrief(Guid threadId, int pageIndex, int pageSize, bool loadBody)
        {
            BriefMessagesContainer container = new BriefMessagesContainer();
            container.Results = GetThreadMessages_Result.Skip(pageIndex * pageSize).Take(pageSize).ToList(); ;
            container.TotalRecords = container.Results.Count;

            return container;
        }

        /// <summary>
        /// Gets the new or modified messages brief.
        /// </summary>
        /// <param name="threadId">The thread id.</param>
        /// <param name="startRange">The start range.</param>
        /// <param name="endRange">The end range.</param>
        /// <param name="pageIndex">Index of the page.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <param name="loadBody">if set to <c>true</c> [load body].</param>
        /// <returns></returns>
        public BriefMessagesContainer GetNewOrModifiedMessagesBrief(Guid threadId, DateTime startRange, DateTime endRange, int pageIndex, int pageSize, bool loadBody)
        {
            BriefMessagesContainer container = new BriefMessagesContainer();
            container.Results = GetNewOrModifiedMessages_Result.Skip(pageIndex * pageSize).Take(pageSize).ToList(); ;
            container.TotalRecords = container.Results.Count;

            return container;
        }

        /// <summary>
        /// Gets the message brief.
        /// </summary>
        /// <param name="messageId">The message id.</param>
        /// <returns></returns>
        public BriefMessage GetMessageBrief(Guid messageId)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the current user.
        /// </summary>
        /// <returns></returns>
        public User GetCurrentUser()
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets all forums brief.
        /// </summary>
        /// <param name="brandName">Name of the brand.</param>
        /// <param name="locale">The locale.</param>
        /// <returns></returns>
        public BriefForumsContainer GetAllForumsBrief(string brandName, int locale)
        {
            BriefForumsContainer container = new BriefForumsContainer();
            container.Results = GetAllForumsBrief_Result;
            container.TotalRecords = container.Results.Count;

            return container;
        }

        /// <summary>
        /// Gets the forums by categories brief.
        /// </summary>
        /// <param name="brandName">Name of the brand.</param>
        /// <param name="locale">The locale.</param>
        /// <param name="categories">The categories.</param>
        /// <returns></returns>
        public BriefForumsContainer GetForumsByCategoriesBrief(string brandName, int locale, List<string> categories)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the forum brief.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <returns></returns>
        public BriefForum GetForumBrief(Guid id)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the threads by forum brief.
        /// </summary>
        /// <param name="forumId">The forum id.</param>
        /// <param name="pageIndex">Index of the page.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <param name="loadBody">if set to <c>true</c> [load body].</param>
        /// <returns></returns>
        public BriefThreadsContainer GetThreadsByForumBrief(Guid forumId, int pageIndex, int pageSize, bool loadBody)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the threads by type brief.
        /// </summary>
        /// <param name="forumId">The forum id.</param>
        /// <param name="threadType">Type of the thread.</param>
        /// <param name="pageIndex">Index of the page.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <param name="loadBody">if set to <c>true</c> [load body].</param>
        /// <returns></returns>
        public BriefThreadsContainer GetThreadsByTypeBrief(Guid forumId, ThreadType threadType, int pageIndex, int pageSize, bool loadBody)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the created threads brief.
        /// </summary>
        /// <param name="forumId">The forum id.</param>
        /// <param name="startRange">The start range.</param>
        /// <param name="endRange">The end range.</param>
        /// <param name="pageIndex">Index of the page.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <param name="loadBody">if set to <c>true</c> [load body].</param>
        /// <returns></returns>
        public BriefThreadsContainer GetCreatedThreadsBrief(Guid forumId, DateTime startRange, DateTime endRange, int pageIndex, int pageSize, bool loadBody)
        {
            BriefThreadsContainer container = new BriefThreadsContainer();
            container.Results = GetCreatedThreads_Result.Skip(pageIndex * pageSize).Take(pageSize).ToList(); ;
            container.TotalRecords = container.Results.Count;

            return container;
        }

        /// <summary>
        /// Gets the updated threads brief.
        /// </summary>
        /// <param name="forumId">The forum id.</param>
        /// <param name="startRange">The start range.</param>
        /// <param name="endRange">The end range.</param>
        /// <param name="pageIndex">Index of the page.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <param name="loadBody">if set to <c>true</c> [load body].</param>
        /// <returns></returns>
        public BriefThreadsContainer GetUpdatedThreadsBrief(Guid forumId, DateTime startRange, DateTime endRange, int pageIndex, int pageSize, bool loadBody)
        {
            BriefThreadsContainer container = new BriefThreadsContainer();
            container.Results = GetUpdatedThreads_Result.Skip(pageIndex * pageSize).Take(pageSize).ToList(); ;
            container.TotalRecords = container.Results.Count;

            return container;
        }

        /// <summary>
        /// Gets the forum threads brief.
        /// </summary>
        /// <param name="forumId">The forum id.</param>
        /// <param name="pageIndex">Index of the page.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <param name="loadBody">if set to <c>true</c> [load body].</param>
        /// <returns></returns>
        public BriefThreadsContainer GetForumThreadsBrief(Guid forumId, int pageIndex, int pageSize, bool loadBody)
        {
            BriefThreadsContainer container = new BriefThreadsContainer();
            container.Results = GetForumThreads_Result.Skip(pageIndex * pageSize).Take(pageSize).ToList(); ;
            container.TotalRecords = container.Results.Count;

            return container;
        }

        /// <summary>
        /// Gets the unanswered question threads brief.
        /// </summary>
        /// <param name="forumId">The forum id.</param>
        /// <param name="pageIndex">Index of the page.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <param name="loadBody">if set to <c>true</c> [load body].</param>
        /// <returns></returns>
        public BriefThreadsContainer GetUnansweredQuestionThreadsBrief(Guid forumId, int pageIndex, int pageSize, bool loadBody)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the answered question threads brief.
        /// </summary>
        /// <param name="forumId">The forum id.</param>
        /// <param name="pageIndex">Index of the page.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <param name="loadBody">if set to <c>true</c> [load body].</param>
        /// <returns></returns>
        public BriefThreadsContainer GetAnsweredQuestionThreadsBrief(Guid forumId, int pageIndex, int pageSize, bool loadBody)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the thread brief.
        /// </summary>
        /// <param name="threadId">The thread id.</param>
        /// <param name="loadBody">if set to <c>true</c> [load body].</param>
        /// <returns></returns>
        public BriefThread GetThreadBrief(Guid threadId, bool loadBody)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Creates the question thread.
        /// </summary>
        /// <param name="forumId">The forum id.</param>
        /// <param name="title">The title.</param>
        /// <param name="body">The body.</param>
        public void CreateQuestionThread(Guid forumId, string title, string body)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Creates the comment thread.
        /// </summary>
        /// <param name="forumId">The forum id.</param>
        /// <param name="title">The title.</param>
        /// <param name="body">The body.</param>
        public void CreateCommentThread(Guid forumId, string title, string body)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Creates the reply.
        /// </summary>
        /// <param name="threadId">The thread id.</param>
        /// <param name="postId">The post id.</param>
        /// <param name="body">The body.</param>
        public void CreateReply(Guid threadId, Guid postId, string body)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Marks the post as answer.
        /// </summary>
        /// <param name="postId">The post id.</param>
        public void MarkPostAsAnswer(Guid postId)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Uns the mark post as answer.
        /// </summary>
        /// <param name="postId">The post id.</param>
        public void UnMarkPostAsAnswer(Guid postId)
        {
            throw new NotImplementedException();
        }



        /// <summary>
        /// Gets the active brands.
        /// </summary>
        /// <returns></returns>
        public List<string> GetActiveBrands()
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the active locales.
        /// </summary>
        /// <returns></returns>
        public List<string> GetActiveLocales()
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets all forums.
        /// </summary>
        /// <param name="brandName">Name of the brand.</param>
        /// <param name="locale">The locale.</param>
        /// <param name="pageIndex">Index of the page.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <returns></returns>
        public ForumsContainer GetAllForums(string brandName, int locale, int pageIndex, int pageSize)
        {
            ForumsContainer container = new ForumsContainer();
            container.Results = GetAllForums_Result.Skip(pageIndex * pageSize).Take(pageSize).ToList(); ;
            container.TotalRecords = container.Results.Count;

            return container;
        }

        /// <summary>
        /// Gets the forums by categories.
        /// </summary>
        /// <param name="brandName">Name of the brand.</param>
        /// <param name="locale">The locale.</param>
        /// <param name="categories">The categories.</param>
        /// <returns></returns>
        public ForumsContainer GetForumsByCategories(string brandName, int locale, List<string> categories)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the forum categories.
        /// </summary>
        /// <param name="brandName">Name of the brand.</param>
        /// <param name="locale">The locale.</param>
        /// <returns></returns>
        public List<Category> GetForumCategories(string brandName, int locale)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the forum.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <returns></returns>
        public Forum GetForum(Guid id)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the type of the threads by.
        /// </summary>
        /// <param name="forumId">The forum id.</param>
        /// <param name="threadType">Type of the thread.</param>
        /// <param name="pageIndex">Index of the page.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <param name="loadBody">if set to <c>true</c> [load body].</param>
        /// <returns></returns>
        public ThreadsContainer GetThreadsByType(Guid forumId, ThreadType threadType, int pageIndex, int pageSize, bool loadBody)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the created threads.
        /// </summary>
        /// <param name="forumId">The forum id.</param>
        /// <param name="startRange">The start range.</param>
        /// <param name="endRange">The end range.</param>
        /// <param name="pageIndex">Index of the page.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <param name="loadBody">if set to <c>true</c> [load body].</param>
        /// <returns></returns>
        public ThreadsContainer GetCreatedThreads(Guid forumId, DateTime startRange, DateTime endRange, int pageIndex, int pageSize, bool loadBody)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the updated threads.
        /// </summary>
        /// <param name="forumId">The forum id.</param>
        /// <param name="startRange">The start range.</param>
        /// <param name="endRange">The end range.</param>
        /// <param name="pageIndex">Index of the page.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <param name="loadBody">if set to <c>true</c> [load body].</param>
        /// <returns></returns>
        public ThreadsContainer GetUpdatedThreads(Guid forumId, DateTime startRange, DateTime endRange, int pageIndex, int pageSize, bool loadBody)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the forum threads.
        /// </summary>
        /// <param name="forumId">The forum id.</param>
        /// <param name="pageIndex">Index of the page.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <param name="loadBody">if set to <c>true</c> [load body].</param>
        /// <returns></returns>
        public ThreadsContainer GetForumThreads(Guid forumId, int pageIndex, int pageSize, bool loadBody)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the unanswered question threads.
        /// </summary>
        /// <param name="forumId">The forum id.</param>
        /// <param name="pageIndex">Index of the page.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <param name="loadBody">if set to <c>true</c> [load body].</param>
        /// <returns></returns>
        public ThreadsContainer GetUnansweredQuestionThreads(Guid forumId, int pageIndex, int pageSize, bool loadBody)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the answered question threads.
        /// </summary>
        /// <param name="forumId">The forum id.</param>
        /// <param name="pageIndex">Index of the page.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <param name="loadBody">if set to <c>true</c> [load body].</param>
        /// <returns></returns>
        public ThreadsContainer GetAnsweredQuestionThreads(Guid forumId, int pageIndex, int pageSize, bool loadBody)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the thread.
        /// </summary>
        /// <param name="threadId">The thread id.</param>
        /// <param name="loadBody">if set to <c>true</c> [load body].</param>
        /// <returns></returns>
        public Thread GetThread(Guid threadId, bool loadBody)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the thread messages.
        /// </summary>
        /// <param name="threadId">The thread id.</param>
        /// <param name="pageIndex">Index of the page.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <param name="loadBody">if set to <c>true</c> [load body].</param>
        /// <returns></returns>
        public MessagesContainer GetThreadMessages(Guid threadId, int pageIndex, int pageSize, bool loadBody)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the new or modified messages.
        /// </summary>
        /// <param name="threadId">The thread id.</param>
        /// <param name="startRange">The start range.</param>
        /// <param name="endRange">The end range.</param>
        /// <param name="pageIndex">Index of the page.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <param name="loadBody">if set to <c>true</c> [load body].</param>
        /// <returns></returns>
        public MessagesContainer GetNewOrModifiedMessages(Guid threadId, DateTime startRange, DateTime endRange, int pageIndex, int pageSize, bool loadBody)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the message.
        /// </summary>
        /// <param name="messageId">The message id.</param>
        /// <returns></returns>
        public Message GetMessage(Guid messageId)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the forum announcements.
        /// </summary>
        /// <param name="forumId">The forum id.</param>
        /// <returns></returns>
        public AnnouncementsContainer GetForumAnnouncements(Guid forumId)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Pings this instance.
        /// </summary>
        /// <returns></returns>
        public string Ping()
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the deleted items.
        /// </summary>
        /// <param name="parentId">The parent id.</param>
        /// <param name="objectType">Type of the object.</param>
        /// <param name="startRange">The start range.</param>
        /// <returns></returns>
        public List<Guid> GetDeletedItems(Guid? parentId, ForumObjectType objectType, DateTime startRange)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the forum facts by brand.
        /// </summary>
        /// <param name="brandName">Name of the brand.</param>
        /// <param name="locale">The locale.</param>
        /// <returns></returns>
        public ForumFactsContainer GetForumFactsByBrand(string brandName, int locale)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the message history.
        /// </summary>
        /// <param name="messageId">The message id.</param>
        /// <returns></returns>
        public MessageHistorysContainer GetMessageHistory(Guid messageId)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the single forum fact.
        /// </summary>
        /// <param name="forumId">The forum id.</param>
        /// <returns></returns>
        public ForumFact GetSingleForumFact(Guid forumId)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the single thread fact.
        /// </summary>
        /// <param name="threadId">The thread id.</param>
        /// <returns></returns>
        public ThreadFact GetSingleThreadFact(Guid threadId)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the assigned threads.
        /// </summary>
        /// <param name="userId">The user id.</param>
        /// <param name="brand">The brand.</param>
        /// <returns></returns>
        public ThreadsContainer GetAssignedThreads(Guid userId, string brand)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
